package com.nju.crawler.remote;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * @authorliyunfei
 * @date2022/11/21
 **/
@Component
public class KafkaGithubInfoConsumer {
       //@KafkaListener(topics = {"test-bigdata-1"})
       public void listenOnTopMessage(ConsumerRecord<?,?> consumerRecord){
              Optional<?> optional = Optional.ofNullable(consumerRecord.value());
              if(optional.isPresent()){
                  System.out.println(optional.get());
              }else{
                  System.out.println("message didn't exisit");
              }
       }


}
